package com.base.library.utils;

import android.content.Context;
import android.util.TypedValue;

/**
 * @author 谢铖志 on 2017/11/14 15:33
 * @version V1.0
 * @modificationHistory
 * @modify by user: 谢铖志 on 2017/11/14 15:33
 */

public class DimensionUtils {
    public static int dp2px(Context context, float dpVal) {
        return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,
                dpVal, context.getResources().getDisplayMetrics());
    }
}
